import SwiftUI

struct SplashScreenView: View {
    @State private var isActive = false
    @State private var opacity = 0.5
    @State private var scale: CGFloat = 0.8
    
    var body: some View {
        if isActive {
            MainTabView()
        } else {
            ZStack {
                Color.blue.opacity(0.2)
                    .ignoresSafeArea()
                
                VStack(spacing: 20) {
                    Image(systemName: "drop.fill")
                        .font(.system(size: 80))
                        .foregroundColor(.blue)
                    
                    Text("AquaReminder")
                        .font(.largeTitle)
                        .fontWeight(.bold)
                    
                    Text("保持健康饮水习惯")
                        .font(.subheadline)
                        .foregroundColor(.secondary)
                }
                .scaleEffect(scale)
                .opacity(opacity)
                .onAppear {
                    withAnimation(.easeIn(duration: 1.0)) {
                        opacity = 1.0
                        scale = 1.0
                    }
                    
                    // 2秒后跳转到主界面
                    DispatchQueue.main.asyncAfter(deadline: .now() + 2.0) {
                        withAnimation {
                            isActive = true
                        }
                    }
                }
            }
        }
    }
} 